<!DOCTYPE html>
<html>
<head>
	<title>个人信息修改</title>
    
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
    <!-- bootstrap -->
    <!-- bootstrap -->
    <link href="/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="/bootstrap/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
    <link href="/bootstrap/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />


    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="/css/user/layout.css" />
    <link rel="stylesheet" type="text/css" href="/css/user/elements.css" />
    <link rel="stylesheet" type="text/css" href="/css/user/icons.css" />



    <!-- this page specific styles 游泳-->
    <link rel="stylesheet" href="/css/user/personal-info.css" type="text/css" media="screen" />

    <!-- open sans font -->
    <link href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css' />


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
    <!-- end navbar -->

	<!-- main container .wide-content is used for this layout without sidebar :)  -->
    <div class="content wide-content">
        <div class="container-fluid">
            <div class="settings-wrapper" id="pad-wrapper">

                <!-- avatar column -->
                <div class="span3 avatar-box">
                    <div class="personal-image">
                        <img src="/images/user/t0.jpg" class="avatar img-circle" />
                        <p>更新头像</p>
                        <input type="file" />
                    </div>
                </div>

                <!-- edit form column -->
                <div class="span7 personal-info">
                    <h5 class="personal-title">个人信息修改</h5>
                    <form />
                        <div class="field-box">
                            <label>用户名:</label>
                            <input type="text" class="span5 inline-input" id="edit_userName" placeholder="用户名称" name="userName" value="admin" />
                        </div>
                        <div class="field-box">
                            <label>密码:</label>
                            <input type="text" class="span5 inline-input" id="edit_password" placeholder="用户密码" name="password" value="123456"/>
                        </div>
                        <div class="field-box">
                            <label>年龄:</label>
                            <input type="text" class="span5 inline-input" id="edit_age" placeholder="年龄" name="age" value="18"/>
                        </div>
                        <div class="field-box">
                            <label>性别:</label>
                            <div class="ui-select">
                            <select id="edit_sex" name="sex" value="男">
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                            </div>
                        </div>

                        <div class="field-box">
                            <label>电话密码:</label>
                            <input type="text" class="span5 inline-input" id="edit_telephone" placeholder="电话" name="telephone" value="xxxx" />
                        </div>
                        <div class="field-box">
                            <label>Email:</label>
                            <input type="text" class="span5 inline-input" id="edit_Email" placeholder="Email"  name="Email" value="xxxx"/>
                        </div>

                        <div class="field-box">
                            <label>地址:</label>
                            <input type="text" class="span5 inline-input" id="edit_address" placeholder="地址" name="address" value="xxxxx"/>
                        </div>
                        <div class="field-box">
                            <label>有无领养经历:</label>
                            <div class="ui-select">
                                <select id="edit_state" name="state" value="${user.state}">
                                    <option value="0">有领养经历</option>
                                    <option value="1">无领养经历</option>
                                </select>
                            </div>
                        </div>
                        <div class="span6 field-box actions">
                            <input type="button" class="btn-glow primary" value="提交修改"  id="user_update_btn" />
                            <input type="button" class="btn-glow primary" value="返回主页" id="return_btn"/>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script src="/js/user/jquery-2.2.3.min.js"></script>
<script src="/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
    $("#return_btn").click(function () {
        window.location.href = "/html/user/index.html";
    });
    $("#user_pic_modal_btn").click(function () {
        var file = $("#myFile");
        file.click();
        file.change(function () {
            var form = new FormData(document.getElementById("update_file"));
            console.log(form);
            $.ajax({
                url: "/html/user/index.html",
                type: "POST",
                data: form,
                async: false,
                processData: false, // 使数据不做处理
                contentType: false, // 不要设置Content-Type请求头
                success: function (result) {
                    alert("头像修改成功");
                    window.location.reload();
                },
                error: function (result) {
                    alert("头像修改失败");
                }
            });
        });
    })
</script>